import fetch from "../config/fetch";

export const version = () => fetch("/admin/login/verify", "GET");
//获取验证码
export const verFlag = (capha, caphaKey) => fetch("/admin/login/detectVerify", "POST", { capha, caphaKey });
//请求验证码是否正确
export const userLogin = (username, password) => fetch("/admin/login/userLogin", "POST", { username, password });
//发送用户名和密码看看是否能登录
export const addNewUser = (username, address, userImg, phone, textInfo) => fetch("/admin/userinfo/addusers", "POST", { username, address, userImg, phone, textInfo });
//添加新用户
export const selectAddress = (text) => fetch("/admin/userinfo/selectAddress", "POST", { text });
//查询地址
export const selectPageUser = (page) => fetch("/admin/userinfo/selectPageUser", "POST", { page });
//查询用户分页
export const selectIdUser = (id) => fetch("/admin/userinfo/selectIdUser", "POST", { id });
//查询某个用户信息
export const deleteFile = (filePath) => fetch("/admin/upload/deleteFile", "POST", { filePath });
//删除文件
export const updateUserInfo = (id, username, address, userImg, password) => fetch("/admin/userinfo/updateUserInfo", "POST", { id, username, address, userImg, password });
//更新某个用户信息
export const deleteUser = (id) => fetch("/admin/userinfo/deleteUser", "POST", { id });
//删除某个用户
export const selectProvince = () => fetch("/admin/userimage/selectProvince", "GET");
//查询省份
export const selectBusineClass = () => fetch("/admin/Businessc/selectBusineClass", "GET");
//查询商家分类
export const selectActivity = () => fetch("/admin/Businessc/selectActivity", "GET");
//查询活动列表
export const addBusActivi = (activeId, businessid, activeText) => fetch("/admin/Businessc/addBusActivi", "POST", { activeId, businessid, activeText });
//添加商店活动
export const selectLikeUser = (text) => fetch("/admin/userinfo/selectLikeUser", "POST", { text });
//查询模糊用户信息
export const addBusinessc = (businessName, businessAddress, businessPhone, businessText, businessTitle, businessPeculiarity, businessDistriMoney, businessSendMoney, startTime, endTime, businessImage, businessLicense, businessPermit, businessUserId, businessClassId, activiBusAll, buSecondClass) => fetch("/admin/Businessc/addBusinessc", "POST", { businessName, businessAddress, businessPhone, businessText, businessTitle, businessPeculiarity, businessDistriMoney, businessSendMoney, startTime, endTime, businessImage, businessLicense, businessPermit, businessUserId, businessClassId, activiBusAll, buSecondClass });
//添加商店
export const selectAllBus = (page) => fetch("/admin/Businessc/selectAllBus", "POST", { page });
//获取分页商店信息
export const updateBusine = (id, businessName, businessAddress, businessText, businessPhone, businessImage, businessClassId, buSecondClass) => fetch("/admin/Businessc/updateBusine", "POST", { id, businessName, businessAddress, businessText, businessImage, businessPhone, businessClassId, buSecondClass });
//更新商店信息
export const deleteBus = (id) => fetch("/admin/Businessc/deleteBus", "POST", { id });
// 删除某个商品
export const addFooClass = (foodClassName, foodClassText) => fetch("/admin/Foodss/addFooClass", "POST", { foodClassName, foodClassText });
//添加商品分类
export const selectFooClass = () => fetch("/admin/Foodss/selectFooClass", "GET");
//查询商品分类
export const addFoods = (foodName, foodText, foodImg, foodPecul, busId, foodClassId, speciList) => fetch("/admin/Foodss/addFoods", "POST", { foodName, foodText, foodImg, foodPecul, busId, foodClassId, speciList });
//添加食品
export const selectFoods = (page) => fetch("/admin/Foodss/selectFoods", "POST", { page });
// 查询食品
export const selectSpeci = (foodId) => fetch("/admin/Foodss/selectSpeci", "POST", { foodId });
//查询规矩
export const deleteSpeci = (id) => fetch("/admin/Foodss/deleteSpeci", "POST", { id });
//删除规格
export const updateFoods = (id, foodName, foodText, foodClassId, foodImg) => fetch("/admin/Foodss/updateFoods", "POST", { id, foodName, foodText, foodClassId, foodImg });
// 跟新食品
export const deleteFoods = (id) => fetch("/admin/Foodss/deleteFoods", "POST", { id });
//删除食品
export const selectOrders = (page) => fetch("/admin/Orderss/selectOrders", "POST", { page });
//查询订单列表
export const updateAdmin = (id, username, address, textInfo, userImg) => fetch("/admin/UserInfo/updateAdmin", "POST", { id, username, address, textInfo, userImg });
//更新管理信息
export const selectAllCount = () => fetch("/admin/userimage/selectAllCount", "GET");
//查询总数据
export const selectTimeUserCount = (today, Yesterday, Daybeforeyesterday) => fetch("/admin/UserInfo/selectTimeUserCount", "POST", { today, Yesterday, Daybeforeyesterday });
